/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.prod.mrp.service.spring;

import java.util.List;
import java.util.Map;

import org.redragon.framework.hibernate.model.Pages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.erp.prod.mrp.dao.ProdMrpBillRDao;
import com.erp.prod.mrp.dao.model.ProdMrpBillR;
import com.erp.prod.mrp.dao.model.ProdMrpBillRCO;
import com.erp.prod.mrp.service.ProdMrpBillRService;

@Service
@Transactional(rollbackFor=Exception.class)
public class ProdMrpBillRServiceImpl implements ProdMrpBillRService {

    //注入Dao
    @Autowired
    private ProdMrpBillRDao prodMrpPoaRDao;
    
    @Override
    public void insertDataObject(ProdMrpBillR obj) {
        this.prodMrpPoaRDao.insertDataObject(obj);
    }

    @Override
    public void updateDataObject(ProdMrpBillR obj) {
        this.prodMrpPoaRDao.updateDataObject(obj);
    }
    
    @Override
    public void insertOrUpdateDataObject(ProdMrpBillR obj) {
        this.prodMrpPoaRDao.insertOrUpdateDataObject(obj);
    }

    @Override
    public void deleteDataObject(ProdMrpBillR obj) {
        this.prodMrpPoaRDao.deleteDataObject(obj);
    }

    @Override
    public List<ProdMrpBillR> getDataObjects() {
        return this.prodMrpPoaRDao.getDataObjects();
    }

    @Override
    public ProdMrpBillR getDataObject(int id) {
        return this.prodMrpPoaRDao.getDataObject(id);
    }

    @Override
    public ProdMrpBillR getDataObject(String code) {
        return this.prodMrpPoaRDao.getDataObject(code);
    }

    @Override
    public List<ProdMrpBillR> getDataObjects(ProdMrpBillRCO paramObj) {
        return this.prodMrpPoaRDao.getDataObjects(paramObj);
    }

    @Override
    public List<ProdMrpBillR> getDataObjects(Pages pages) {
        return this.prodMrpPoaRDao.getDataObjects(pages);
    }
    
    @Override
    public List<ProdMrpBillR> getDataObjects(Pages pages, ProdMrpBillRCO paramObj) {
        return this.prodMrpPoaRDao.getDataObjects(pages, paramObj);
    }
    
    @Override
    public List<Map<String, Object>> getDataObjectsArray(Pages pages, ProdMrpBillRCO paramObj) {
        return this.prodMrpPoaRDao.getDataObjectsArray(pages, paramObj);
    }
    
    @Override
    public List<ProdMrpBillR> getDataObjectsForDataAuth(String dataAuthSQL, Pages pages, ProdMrpBillRCO paramObj) {
        return this.prodMrpPoaRDao.getDataObjectsForDataAuth(dataAuthSQL, pages, paramObj);
    }
    
    @Override
    public void deleteRelateByMrpHeadCode(String mrpHeadCode) {
        this.prodMrpPoaRDao.deleteRelateByMrpHeadCode(mrpHeadCode);
    }
    
    @Override
    public boolean isExistMrpLineRelateBill(String mrpHeadCode, String mrpLineCode, String billType) {
        return this.prodMrpPoaRDao.isExistMrpLineRelateBill(mrpHeadCode, mrpLineCode, billType);
    }
    
    @Override
    public List<ProdMrpBillR> getRelateByMrpHeadCode(String mrpHeadCode, String billType) {
        return this.prodMrpPoaRDao.getRelateByMrpHeadCode(mrpHeadCode, billType);
    }
    
}